package JZ;

import java.util.Arrays;

public class JZ03 {
    public int findRepeatNumber(int[] nums) {
        int max = nums.length;
        int[] ints = new int[max + 1];
        Arrays.fill(ints,0);
        for (int num : nums) {
            if(ints[num]==1) return num;
            ints[num] = 1;
        }
        return -1;
    }
}
